<?php

/**
 * Created by PhpStorm.
 * User: zhangshiping
 * Date: 2016/10/27
 * Time: 10:49
 */
namespace Common\Behaviors;
class configBehavior extends \Think\Behavior{
    //动态配置数据库
    public function run(&$param){
        $map['k'] = 'cinema_type_map';
        $config = json_decode(M('config')->where($map)->find()['v'],true);
        $res = [];
        foreach($config as $key=>$value){
            $res['DB_CONFIG'.$key] = $value['database'].'_play';
        }
        C($res);
    }
}